package com.after.saas.mall.admin.controller;

import com.after.saas.common.model.dto.UserDTO;
import com.after.saas.mall.admin.service.AdminService;
import org.springframework.web.bind.annotation.*;

/**
 * @Classname AdminController
 * @Description TODO
 * @auth after
 * @since 2023/3/26 18:09
 */

@RestController
@RequestMapping("/admin")
public class AdminController {

    private final AdminService adminService;

    public AdminController(AdminService adminService) {
        this.adminService = adminService;
    }

    @RequestMapping(value = "/loadByUsername", method = RequestMethod.GET)
    public UserDTO loadUserByUsername(@RequestParam String username) {
        return  adminService.loadUserByUsername(username);
    }
}
